//
//  LEBaseViewController.m
//  LoveExpressBusiness
//
//  Created by 刘甲奇 on 2017/5/9.
//  Copyright © 2017年 DFH. All rights reserved.
//

#import "ZDBaseViewController.h"
#import "ZDAlertController.h"

@interface ZDBaseViewController ()

@end

@implementation ZDBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
    [self loadData];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginWithOtherDevice:) name:LOGIN_OTHERDEVICE_NOTIFICATION object:nil];
}

- (void)setupUI
{
    self.view.backgroundColor = [UIColor whiteColor];
    SVProgressHUD.minimumDismissTimeInterval = 1;
}
- (void)loadData
{
    
}
- (void)loginWithOtherDevice:(NSNotification *)notification
{

    dispatch_async(dispatch_get_main_queue(), ^{
        ZDAlertController *alertController = [[ZDAlertController alloc] init];
        __weak typeof (self) weakSelf = self;
        [alertController showAlertTitle:@"温馨提示" content:@"您的账号从其他设备上登录了,请重新登录" clickBlock:^(ButtonTitle title) {
            [alertController dismissViewControllerAnimated:YES completion:nil];
            if (title == AlertSure) {
                [weakSelf presentLoginController];
            }
        }];
        [self presentViewController:alertController animated:YES completion:nil];
        
    });

}

@end






